
from django.contrib import admin
from django.urls import path,include
from django.conf import settings
from django.conf.urls.static import static
from utils.upload import upload_file   # 富文本编辑器上传图片方法

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('blog.urls')),
    path('users/', include('users.urls')),
    path('uploads/', upload_file, name='uploads')   # 上传图片url   

]+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)  # 配置静态文件url

# 配置用户上传文件url

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


admin.site.site_header = "博客管理后台"
admin.site.index_title = "博客管理后台"
admin.site.site_title = "管理员已登录"